ARG VERSION=3.13.1
FROM alpine:${VERSION}

# using mirror
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories 

RUN apk add --no-cache --virtual .build-deps \
        git \
        openssh-server \
        libstdc++ \
        clang \
        clangd \
        cmake \
        make \ 
        # config ssh server
        && sed -E 's/^#(PermitRootLogin )no/\1yes/' /etc/ssh/sshd_config -i && ssh-keygen -A && /usr/sbin/sshd &

VOLUME /code

RUN ["/bin/sh"]


